DAC Street Boys - DAC Support for STM32 F3xx and F4xx#123
Open
oleglazari wants to merge 10 commits intomainfrom
Open
DAC Street Boys - DAC Support for STM32 F3xx and F4xx#123oleglazari wants to merge 10 commits intomainfrom
oleglazari wants to merge 10 commits intomainfrom
Conversation
removed dac samples i made in my dreams refactored dac to be more like adc lowkey forgot externs lowkey got rid of useless extern + comments dac doc added dac sample Squashed dac changes
DiegoLHendrix
approved these changes
Sep 29, 2025
| static bool checkSupport(DACPeriph periph, Channel_Support channelStruct); | ||
|
|
||
| void initDAC(); | ||
| void initGPIO(); |
Contributor
There was a problem hiding this comment.
Add descriptions for these methods
Contributor
Author
There was a problem hiding this comment.
chat these methods are like not worth documenting
Contributor
There was a problem hiding this comment.
I am with Diego on this, add at least a little description.
ActuallyTaylor
requested changes
Oct 6, 2025
Member
ActuallyTaylor
left a comment
There was a problem hiding this comment.
The code looks great! However, I do have some recommendations for using #define, and some doc changes.
ActuallyTaylor
approved these changes
Oct 8, 2025
mjh9585
requested changes
Oct 10, 2025
Contributor
mjh9585
left a comment
There was a problem hiding this comment.
Bunch of nitpicks, but a good start. You are missing a DAC on the STM32F334 so you will need to add multi-dac support on F3.
| static bool checkSupport(DACPeriph periph, Channel_Support channelStruct); | ||
|
|
||
| void initDAC(); | ||
| void initGPIO(); |
Contributor
There was a problem hiding this comment.
I am with Diego on this, add at least a little description.
- Fix DAC macro naming conflict by using DigitalToAnalogConverter typedef - Replace all magic numbers with named constants in DAC sample - Add comprehensive function documentation for sample test functions - Improve code maintainability and readability - All build issues resolved, ready for merge
- Add conditional compilation for DAC2 support - STM32F302x8 only supports DAC1, STM32F334x8 supports both DAC1 and DAC2 - Use preprocessor directives to handle variant differences - Fixes build errors on STM32F302x8 while maintaining full functionality on STM32F334x8 - Resolves mjh9585's comment about missing DAC support on F334 variants
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements DAC support on STM32 F3xx and F4xx microcontrollers. The code follows the STM32 HAL initialization sequence, includes input validation by clamping DAC values to a 12-bit maximum (4095), and supports both device families. This implementation will make DAC functionality easier to maintain and extend.
Why is it useful? idk safety i guess
Changes